<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login</title>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.js"></script>
    <script type="text/javascript">
        function submitLoginForm()
        {
            let Username=document.getElementById('username').value;
            let Password=document.getElementById('password').value;
            $.ajax({
                type: "POST",
                contentType: "application/json",
                data: JSON.stringify({
                    Username,
                    Password
                }),
                url: "http://localhost:8080/login",
                success: (result)=>{
                    alert('登陆成功');
                }
            })
        }
    </script>
</head>
<body>
    <form>
        <label>
            用户名：<input id="username" type="text"/><br/>
            密码：<input id="password" type="password"/><br/>
        </label>
        <input type="button" value="登录" onclick="submitLoginForm()">
    </form>

</body>
</html>